/// @tags: Matrix Xor
#include <cstdio>
#include <cstring>
#include <iostream>

using namespace std;

namespace BlueQuantum {

typedef long long uint;

int const N = 1e2 + 5, K = 32;

int n, m, q;

struct Matrix;

struct Vector {
  uint a[N];

  Vector() { memset(a, 0, sizeof(a)); }

  inline uint &operator[](int index) { return a[index]; }
  inline uint const &operator[](int index) const { return a[index]; }

  inline Vector operator*(Matrix const &rhs) const;
} A;

struct Matrix {
  Vector a[N];

  Vector &operator[](int index) { return a[index]; }
  Vector const &operator[](int index) const { return a[index]; }

  inline Matrix operator*(Matrix const &rhs) const;
} T[K];

inline Vector Vector::operator*(Matrix const &rhs) const {
  Vector res;
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) res.a[i] ^= a[j] * rhs[j][i];
  return res;
}

inline Matrix Matrix::operator*(Matrix const &rhs) const {
  Matrix res;
  for (int i = 0; i < n; ++i) res[i] = a[i] * rhs;
  return res;
}

inline ostream &operator<<(ostream &os, Vector const &rhs) {
  for (int i = 0; i < n; ++i) os << rhs.a[i] << ' ';
  os << '\n';
  return os;
}

inline ostream &operator<<(ostream &os, Matrix const &rhs) {
  for (int i = 0; i < n; ++i)
    for (int j = 0; j < n; ++j) os << rhs[i] << ' ';
  cout << '\n';
  return os;
}

inline void prework() {
  for (int j = 1; j < K; ++j) T[j] = T[j - 1] * T[j - 1];
}

inline Vector query(Vector x, uint t) {
  for (int i = 0; t; t >>= 1, ++i)
    if (t & 1) x = x * T[i];
  return x;
}

inline int main() {
  cin >> n >> m >> q;
  for (int i = 0; i < n; ++i) cin >> A[i];
  for (int i = 1, x, y; i <= m; ++i) {
    cin >> x >> y;
    --x, --y;
    T[0][x][y] = T[0][y][x] = 1;
  }
  prework();
  for (uint t; q; --q) {
    cin >> t;
    Vector ans = query(A, t);
    cout << ans[0] << '\n';
  }
  return 0;
}

}  // namespace BlueQuantum

int main() {
#ifndef ONLINE_JUDGE
#ifdef LOCAL
  freopen("/tmp/CodeTmp/testdata.in", "r", stdin);
  freopen("/tmp/CodeTmp/testdata.out", "w", stdout);
#else
  freopen("P6569 [NOI Online #3 提高组] 魔法值.in", "r", stdin);
  freopen("P6569 [NOI Online #3 提高组] 魔法值.out", "w", stdout);
#endif
#endif

  ios::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  return BlueQuantum::main();
}
